import store from '../stores'

import router from '../router'

router.beforeEach((to, from, next) => {
    if(store.useUserStore.token){//token有值
        if(to.path == '/login'){
            next("/")
        }else{
            next()
        }
    }else{
        if(to.path == '/login'){
            next()
        }
        next('/login')
    }
})